package designpatterns.observer;

public class Main {
    public static void main(String[] args) {
        Subject subject = new ConcreteSubject();
        Observer ob1 = new ConcreteObserverA();
        Observer ob2 = new ConcreteObserverB(); // 扩展
        subject.attach(ob1);
        subject.attach(ob2); // 扩展
        ((ConcreteSubject)subject).service();
    }
}
